<!-- 卡券管理 -->
<template>
  <el-table :data="tableList" style="width: 100%" v-loading="loading">
    <el-table-column label="序号"  type="index" width="55" align="center"/>
    <el-table-column label="卡券名称" prop="couponName" align="center"/>
    <el-table-column label="卡券金额" prop="discount" align="center"/>
    <el-table-column label="卡券有效期" prop="endTime" align="center"/>
    <el-table-column label="卡券状态" align="center" width="90">
      <template #default="scope">
        <span v-if="scope.row.status == 1">未使用</span>
        <span v-if="scope.row.status == 2">已使用</span>
        <span v-if="scope.row.status == 3">已作废</span>
      </template>
    </el-table-column>
  </el-table>
  <el-image  :src="imageSrc"  style="width: 100%"  />
</template>

<script lang='ts' setup>
import {ref, onMounted,reactive} from 'vue'
import imageSrc from "@/assets/test/kqgl.png";
import {postCouponList} from '@/api/couponApi/couponApi'
onMounted(()=>{
    couponList()
})
const tableList = ref([])
//加载
const loading = ref(false)
const tableForm = reactive({
    couponName:'1'
})
  const couponList = async ()=>{
      loading.value = true
    let res = await postCouponList(tableForm)
      console.log(res)
      tableList.value = res.data.data
      loading.value = false
  }
</script>
<style scoped lang='scss'>
</style>
